package pers.lance.mvcrest.plus.plus.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import pers.lance.mvcrest.plus.plus.dao.BookDao;
import pers.lance.mvcrest.plus.plus.pojo.Book;
import pers.lance.mvcrest.plus.plus.service.BookService;

import java.util.List;

/**
 * @ Author     ：LILA3
 * @ Date       ：Created in 6:37 PM 7/26/2018
 */
@Service
public class BookServiceImpl implements BookService {
    @Autowired
    private BookDao bookDao;

    @Override
    @Transactional
    public Book addBook(Book book) {
        return bookDao.insert(book);
    }

    @Override
    public Book updateBook(Book book) {
        return null;
    }

    @Override
    public Book deleteBook(Book book) {
        return null;
    }

    @Override
    public Book findById(Book book) {
        return bookDao.findById(book.getId());
    }

    @Override
    public List<Book> findAll() {

        return null;
    }
}
